<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取设备唯一标志</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<body>
<p class="p" style="font-size: 40px">

</p>
<p class="p2" style="font-size: 40px">

</p>
</body>
<script>
    $(document).ready(function () {
        console.log(2222222222222)
        $('.p').html('特会突然回头让好人挺好')
            if(window.plus){
                            if(ua.match(/iphone\sOS/i) == "iphone os"){//识别设备ios/android
                            var ASIdentifierManager = plus.ios.importClass("ASIdentifierManager");
                            var sharedManager = ASIdentifierManager.sharedManager();
                            if(sharedManager.isAdvertisingTrackingEnabled()){
                            var advertisingIdentifier = sharedManager.advertisingIdentifier();
                            var idfa = plus.ios.invoke(advertisingIdentifier,"UUIDString");
                            return idfa;  // 获取并返回idfa
                            console.log(idfa)
                            console.log(7777777777777777)
                            document.write(idfa+"熊大")
                            document.write("熊二")
                        }
                        // var UIDevice = plus.ios.importClass("UIDevice");
                        // var currentDevice = UIDevice.currentDevice();
                        // console.log("名字为: "+currentDevice.name());
                        // plus.ios.deleteObject(currentDevice);
                    }else{
                        var device_id = plus.device.uuid.valueOf();
                        return device_id;

                        // var mainActivity = plus.android.runtimeMainActivity();
                        // var Settings= plus.android.importClass("android.provider.Settings");
                        // console.log(Settings.Secure.getString(mainActivity.getContentResolver(),Settings.Secure.ANDROID_ID));
                    }
            }
    })
</script>
<script type="text/javascript">
    $(document).ready(function () {
        function judgePlatform(){
            switch ( plus.os.name ) {
                case "Android":
                    // Android平台: plus.android.*
                    document.write("您是安卓手机")
                    break;
                case "iOS":
                    // iOS平台: plus.ios.*
                    document.write("您是苹果手机")
                    break;
                default:
                    // 其它平台
                    break;
            }
        }
    })
    function share(shareTip, shareText) {
        //导入Java类对象
        var Context = plus.android.importClass("android.content.Intent");
        //获取应用主Activity
        var Main = plus.android.runtimeMainActivity();
        //将类Context的这个行为(Action)ACTION_SEND，赋给shareIntent
        var shareIntent = new Context(Context.ACTION_SEND);
        //***以下两种写法是一样的
        //***1.
        //plus.android.invoke(shareIntent,"setType","text/plain");
        //plus.android.invoke(shareIntent,"putExtra",Context.EXTRA_TEXT,shareText);
        //***2.
        //设置分享类型
        shareIntent.setType("text/plain");
        //设置分享文本
        shareIntent.putExtra(Context.EXTRA_TEXT, shareText);
        //***以上两种写法是一样的
        //指定分享的包名
        //shareIntent.setPackage('com.tencent.mm',);
        Main.startActivity(Context.createChooser(shareIntent, shareTip));
    }
</script>
<script>
    <!--现实显卡的型号-->
    (function () {
        var canvas = document.createElement('canvas'),
            gl = canvas.getContext('experimental-webgl'),
            debugInfo = gl.getExtension('WEBGL_debug_renderer_info');

        $('.p2').html("设备显卡型号："+gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL));
    })();
</script>
</html>